﻿<Window x:Class="Serietheque.Fenetres.MissingEpisodes"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Missing" Height="300" Width="300">
    <Grid>
        <DataGrid Name="DgMissedEpisodes" Grid.Row="1" 
                  CanUserAddRows="False" AutoGenerateColumns="False">
            <DataGrid.GroupStyle>
                <GroupStyle>
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding Path=Name}" />
                            </StackPanel>
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                    <GroupStyle.ContainerStyle>
                        <Style TargetType="{x:Type GroupItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type GroupItem}">
                                        <Expander>
                                            <Expander.Header>
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Name.Name}" />
                                                    <TextBlock Text=" - "/>
                                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                                    <TextBlock Text=" Items"/>
                                                </StackPanel>
                                            </Expander.Header>
                                            <ItemsPresenter />
                                        </Expander>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </GroupStyle.ContainerStyle>
                </GroupStyle>
            </DataGrid.GroupStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Header="Air Date" Binding="{Binding AirDate, StringFormat=d}" />
                <DataGridTextColumn Header="Nom" Binding="{Binding Name}" CellStyle="{StaticResource Test}" />
                <DataGridTextColumn Header="Saison" Binding="{Binding Saison.Num, StringFormat=Saison \{0:D\}}" />
                <DataGridTextColumn Header="Numéro" Binding="{Binding Num}"  />
                <DataGridTextColumn Header="Episode" Binding="{Binding Name}" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
